home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / snip0493.zip / ABSDISKC.C < prev    next >
C/C++ Source or Header  |  1993-04-05  |  1KB  |  35 lines

  1. /*
  2. **  ABSDISKC.C - Functions to read and write absolute disk sectors
  3. **               (these will work with all versions of DOS 2-5).
  4. **
  5. **  Public domain code by Bob Stout
  6. **
  7. **  NOTE: These functions work by calling absdisk() from SNIPPETS file,
  8. **        ABSDISK.ASM.
  9. */
  10.  
  11. #include <stddef.h>
  12. #include <dos.h>
  13.  
  14. int absdisk(unsigned char  function,
  15.             unsigned short drive,
  16.             size_t         number_of_sectors,
  17.             size_t         starting_sector,
  18.             void *         sector_buffer);
  19.  
  20. int AbsDiskRead(unsigned short drive,
  21.                 size_t         num_of_sectors,
  22.                 size_t         sector,
  23.                 void          *ptr)
  24. {
  25.       return absdisk(0x25, drive, num_of_sectors, (unsigned)sector, ptr);
  26. }
  27.  
  28. int AbsDiskWrite(unsigned short drive,
  29.                 size_t         num_of_sectors,
  30.                 size_t         sector,
  31.                 void *ptr)
  32. {
  33.       return absdisk(0x26, drive, num_of_sectors, (unsigned)sector, ptr);
  34. }
  35.